﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data;
using MySql.Data.MySqlClient;
using System.Data.OleDb;



namespace functionService
{
    enum  reportParam { aCaptions, aWidth, heightRows, fontSizeRows, fontSizeHeader }
    class serfun_city7
    {
        public static string message = "";
        public static string  path_sklad_import;
        public static object currentZakaz;
        public static object kol;
        public static bool kolSet_bool;
        public static int iselect_888All_0vispoln_1fiskal_2predch_20predchVispol_zakaz;
        public static int fiskalDocAfterPrint_0no_1yes;
        public static object editParam_date_25;
        public static string sir_org_23;
        public static string o_l_0;
        public static string list_sourse;
        

        public static string currentZakaz_STR { get {return currentZakaz.ToString(); }}
        public static int currentZakaz_INT {get{ return Convert.ToInt32(currentZakaz);} }
        public static string kol_STR {get{ return kol.ToString();} }
        public static double kol_DBL {get{ return Convert.ToDouble(kol);} }
        public static int kol_INT { get { return Convert.ToInt32(kol); } }
        
        public static int editParam_date_25_int 
        {
            get 
            {
                return Convert.ToInt32(functionService.DATECOD.date_to_cod_int(editParam_date_25));
            } 
        }
        public static int sir_org_23_CodInt
        {
            get
            {
                return Convert.ToInt32(functionService.nameCod.readCod(sir_org_23));
            }
        }

        public static string  o_l_0_name
        {
            get
            {
                return functionService.nameCod.readName(o_l_0);
            }
        }
        public static int o_l_0_cod
        {
            get
            {
                return Convert.ToInt32(functionService.nameCod.readCod(o_l_0));
            }
        }
        public class ost_create
        {//31	28	31	30	31	30	31	31	30	31	30	31

            public static int year, month, dayB_1, dayE_31;
             
            //public static int monthNext, dayNextMoth_1;
            public static int  monthNext {   get { if (month == 12) { return 1; } else { return month + 1; } }    }
            public static int  dayB_monthNext   {  get {  return 1;  }   }
            static int Febriary_2829
            {
                get{
                    switch (year)
                    {
                        case 2008: return 29; break;
                        case 2012: return 29; break;
                        case 2016: return 29; break;
                        case 2020: return 29; break;
                        case 2024: return 29; break;
                        case 2028: return 29; break;
                        case 2032: return 29; break;
                        case 2036: return 29; break;
                        case 2040: return 29; break;
                        case 2044: return 29; break;
                        case 2048: return 29; break;
                        case 2052: return 29; break;
                        case 2056: return 29; break;
                        case 2060: return 29; break;
                        case 2064: return 29; break;
                        case 2068: return 29; break;
                        case 2072: return 29; break;
                        case 2076: return 29; break;
                        case 2080: return 29; break;
                        case 2084: return 29; break;
                        case 2088: return 29; break;
                        case 2092: return 29; break;
                        case 2096: return 29; break;
                        case 2100: return 29; break;
                        default:
                            return 28; break;
                    }
                }
            }
            static int maxDayInMonth(int monthNumber)
            {
                switch (monthNumber)
                {
                    case 1:
                        return 31;     break;
                    case 2:
                        return Febriary_2829; break;
                    case 3:
                        return 31; break;
                    case 4:
                        return 30; break;
                    case 5:
                        return 31; break;
                    case 6:
                        return 30; break;
                    case 7:
                        return 31; break;
                    case 8:
                        return 31; break;
                    case 9:
                        return 30; break;
                    case 10:
                        return 31; break;
                    case 11:
                        return 30; break;
                    case 12:
                        return 31; break;
                    default:
                        return 31; break;
                }

            }
            public static bool IsOkCondition
            { 
                get 
                {
                    bool b=false ;

                    if (dayE_31 == maxDayInMonth(month) && dayB_1==1) b = true; else b = false;

                    return b; 
                
                } 
            }

            public static int codd_203011900
            {
                get
                {
                    int y = 1, m = ost_create.month, codd = 0, d = 1;
                    if (month == 12) { m = 1; y = DATECOD.yearCod_2_from_year2011( year + 1); } 
                    else if (month >= 1 || month < 12) { m = month + 1; y = DATECOD.yearCod_2_from_year2011( year); }
                    codd = ((y * 100 + m) * 100 + d) * 10000 + 1900;
                    return codd;
                }
            }
            public static int dd_20110301
            {
                get
                {
                    int y = year, m = ost_create.month, d = 1;
                    if (month == 12) { m = 1; y = (year + 1); }
                    else if (month >= 1 || month < 12) { m = month + 1;}
                    return ((y * 100 + m) * 100 + d);
                }
            }
            public static int year2011_from_yaerCod2(int yo)
            {
                return 2009 + yo;
            }
            public static int year_month_COD_203
            {
                get
                {
                    int y = DATECOD.yearCod_2_from_year2011(year), m = month, ym = y * 100 + m;
                    return ym;
                }
            }
        }
        public class codKol
        {
            public static bool bKnowCod, enterEnter;
        }
        public class RPT
        {
            public static  string report_RezPodr = "RP" ;
            public static  string report_RezReestr = "RR";
            public static string currentReport;
            public static string stringControlGroup;
            public static int lp, col, yb;


            public static string dataZ = "00-00-00";
          
            public static string currentReport_head;

            public static object okol;
            public static string showCod_1yes_0no;
            public static string nameProd;
        }
        public class RPT_ost_look
        {
            public static string currentReport;
            public static string report_ost = "ost";
            public static string report_ost_blank = "blank";
            public static string report_ost_sum = "ost_sum";

        }
        public class rz
        {
            public static string add_prod_default;
            public static string add_sirT_default;
            public static double add_kolV_default;
            public static int currentColumn;
            public static int currentRow;
            public static object currentCod123;
            public static object currentNameCodSc;

            public static string currentCodSc
            {
                get { return  nameCod.readCod(currentNameCodSc.ToString()); }
            }

            //public static object currentCodSc;
            public static object currentCodTs;
            public static object kolV;

            public static string filterProd;
            public static bool AddContinue;
            public static bool enterCodTrue;

            public static DataTable dt_Copy;
            public static DataView dv_Copy;
            public static bool pasteTrue;
            

            public class sql
            {
                public static string add(int intCodProd, double kolVih)
                {
                    return string.Concat("call `city`.`rz_insert_To_mainListr_and_mainListr_sc` (", intCodProd, ", ", kolVih, ");");
                }
                public static string rz_insert_To_list_sc_mainlistr(object codsc, object codrz)
                {//`city`.`rz_insert_To_list_sc_mainlistr`(codsc0 int, codrz0 int)
                    return string.Concat("call `city`.`rz_insert_To_list_sc_mainlistr` (", codsc, ", ", codrz, ");");
                }
                public static string del(int intCod123)
                {
                    return string.Concat("call `city`.`rz_delete_cod123`(", intCod123, ");");
                }
                public static string DEL_FROM_list_sc_tehsir_z(object  CODSC)
                {
                    return string.Concat("DELETE FROM list_sc_tehsir_z WHERE CODSC=", CODSC ,";");
                }
                public static string delete_list_sc_mainlistr(object CODSC)
                {
                    return string.Concat("call `city`.`delete_list_sc_mainlistr`(", CODSC, ");");
                }
                public static string add_list_sc_tehsir_z(object codSc)
                {
                    return string.Concat("call `city`.`rz_insert_To_list_sc_tehsir_z` (", codSc, ");");
                }
                //`city`.`add_pf` ()
                public static string add_list_sc_tehsir_z_newCodSc()
                {

                    return string.Concat("call `city`.`add_pf` ();");

                }
                public static string pasteCopyRZ(object codSc, object codTs, object kol)
                {
                    return string.Concat("insert into mainlistr(codSc,codSirTeh,kol) values (", 
                        codSc, ",", codTs, ",", kol.ToString().Replace(",","."), ");");
                }
                public static string pasteCopyRZvihod(object codSc, object kolV)
                {
                    return string.Concat("insert into mainlistr_sc(codSc, kolV) values (",
                        codSc, ",", kolV.ToString().Replace(",", "."), ");");
                }

            }
        }

        public class editTd
        {/*
name
kol
kol2
pr
--sd
codd
cod123*/
            public static string currentCod123;
            public static string name_cod;
            public static string ct;
            public static object ves;
            public static string kol;
            public static string kol2;
            public static string pr;
            public static string codd;
        }

        public class sirTehSir
        {
            
            public static int currentColumn;
            public static int currentRow;
            public static object currentCod123;
            public static object currentTehSir_nameCod;
            public static object currentTehSir_Cod;
            public static object currentCodSklad;

            public static string filterProd;
            public static bool trueSet_from_CurrentTehSir;
            public static bool trueMemo;
            public static double ep;

            public static string CurrentTehSir_cod
            {
                get 
                {
                  return  functionService.nameCod.readCod(currentTehSir_nameCod.ToString()); 
                }
                set { currentTehSir_Cod = value; }
            }
            public static string CurrentTehSir_name
            {
                get
                {
                    return functionService.nameCod.readName(currentTehSir_nameCod.ToString());
                }
            }
        }
        public class ost_sum_kol
        {
            public static bool sumTrue_kolFalse;
        }
        public class rd
        {
            public static int year;
            public static int month;
            public static int day;
            public static int dateSmena
            {
                get 
                {
                    return Convert.ToInt32(string.Concat(year, shorts.nn(month), shorts.nn(day)));
                }
            }
           
        }
        public class filter
        {
            public static string  tag;
            public static bool IsSave;
        }



        public class PRINT_GRID
        {
            public static bool boolLoadFromXML;
            public static DataTable tableParamReport, tableSourseReport;
            public static string report_RezPodr = "RP";
            public static string report_RezReestr = "RR";

            public static string currentReport;
            
            public static string[] aCaptions;
            public static int[] aWidth;
            public static int heightRows, fontSizeRows, fontSizeHeader;

            public static void loadCaptionsAndWidth_FromDataGrid_ToArray(System.Windows.Forms.DataGridView dgv)
            {
                for (int j = 0; j < dgv.RowCount; j++)
                {
                    aCaptions[j] = dgv.Columns[j].HeaderText;
                    aWidth[j] = dgv.Columns[j].Width;
                }
            }
            public static string filePLP_REPORTS(string fileNameWithoutExt)
            {
                return string.Concat("PLP\\REPORTS\\", fileNameWithoutExt, ".xml");
            }
            public void saveToXML(DataTable dto, string nameFileWithoutExt)
            {
                dto.WriteXml(filePLP_REPORTS(nameFileWithoutExt), XmlWriteMode.WriteSchema);
            }

            public static string tagCAPTIONS
            {
               get 
               {
                   string s;
                   s = functionService.tagWork.putArray_ToTag(aCaptions);
                   return s;
               }
            }
            public static string tagWIDTH
            {
                get
                {
                    string s;
                    s = functionService.tagWork.putArray_ToTag(aWidth);
                    return s;
                }
            }
            public static string take(reportParam rep)
            {
                return tableParamReport.Rows[(int)rep][1].ToString();
            }
            public static int take_int(reportParam rep)
            {
                return  Convert.ToInt32( tableParamReport.Rows[(int)rep][1]);
            }
            public static string take(int indexParam)
            {
              return tableParamReport.Rows[indexParam][1].ToString();
            }
            public static void put(int indexParam, object ovalue)
            {
                tableParamReport.Rows[indexParam][1] = ovalue.ToString();
            }

            public static void loadParamFromXMLTable_and_loadDataViewToTable(System.Windows.Forms.DataGridView dgv)
            {
              //  functionService.shorts.m(20);
               aCaptions = tagWork.readTAG_ToArray(take(reportParam.aCaptions));
               aWidth = tagWork.readTAG_ToArrayInt(take(reportParam.aWidth));
               heightRows = take_int(reportParam.heightRows);
               fontSizeRows = take_int(reportParam.fontSizeRows);
               fontSizeHeader = take_int(reportParam.fontSizeHeader);


               tableSourseReport = (DataTable)dgv.DataSource;
            }

            public static void loadDataViewToTable(System.Windows.Forms.DataGridView dgv)
            {
                
            }

        }
    }
    class sql_sklad
    {
        public static string insert_sklad_rd_123__from__sklad_rd_123t(string Month01o)
        {
            // 0 as codd, nd, dd, 'Нк' as vd, 4 as codo
            string s = string.Concat
                (
                    "INSERT INTO citytemp", Month01o, ".sklad_rd_123(codd, nd, dd)",
                    " SELECT codd, nd, dd FROM citytemp", Month01o, ".sklad_rd_123t;"
                );
            return s;
        }

        public static string insert_sklad_rd_123t(object codd, object nd, object dd, string Month01o)
        {
            string s = string.Concat
                (
                    "INSERT INTO citytemp", Month01o, ".sklad_rd_123t(codd, nd, dd)",
                    " VALUES (", codd, ",", nd, ",", dd, ");"
                );
            return s;
        }

        public static string sklad_rd_all()
        {
            string s = string.Concat("SELECT rd.Nd, rd.dd, rd.vd, rd.corg, rd.dp1, rd.dp2, rd.dp3 FROM rd;"); return s;
        }
        public static string rd_sklad(object ocorgo8280)
        {
            string s = string.Concat("SELECT rd.Nd, rd.dd, rd.vd, rd.corg, rd.dp1, rd.dp2, rd.dp3 FROM rd where corg=", ocorgo8280
                , " and Nd>0 and vd = 'Нк' order by Nd;"); return s;
        }
        public static string td_sklad(object ocorgo8280)
        {
            string s = string.Concat("SELECT td.ndt, td.pp, td.sk, td.ct, td.p2, td.p1, td.mt, td.mnt1, td.mnt2, td.nds,",
                " td.crd, td.deb, td.sopp, td.nsk, td.p5t",
                " FROM rd LEFT JOIN td ON rd.Nd = td.ndt WHERE (((rd.corg)=", ocorgo8280, "));");
            return s;
        }
        public static string ADD_sir_rd_sklad(object cod123o, object ndo, object ddo, object vdo, object corgo, object dp1o, object dp2o, object dp3o)
        {
            string sql_dml =
            string.Concat(" insert into sir_rd_sklad(cod123, nd, dd, vd, corg, dp1,  dp2, dp3)",
            " VALUES (", cod123o, ",", ndo, ",   '", ddo, "', '", vdo, "', ", corgo, ", '", dp1o, "', '", dp2o, "', '", dp3o, "');");
            return sql_dml;
        }
        public static string ADD_data_sklad_rd(object ndo, object ddo, object vdo,
            object corgo, object dp1o, object dp2o, object dp3o)
        {
            string sql_dml =
            string.Concat(" insert into data.sklad_rd(Nd, dd, vd, corg, dp1,  dp2, dp3)",
            " VALUES (", ndo, ",   '", ddo, "', '", vdo, "', ", corgo, ", '",
                                       dp1o, "', '", dp2o, "', '", dp3o, "');");
            return sql_dml;
        }
        public static string ADD_sir_rd_sklad0(object cod123o, object ndo, object ddo, object vdo, object corgo, object dp1o, object dp2o, object dp3o)
        {
            string sql_dml =
            string.Concat(" insert into sir_rd_sklad0(cod123, nd, dd, vd, corg, dp1,  dp2, dp3)",
            " VALUES (", cod123o, ",", ndo, ",   '", ddo, "', '", vdo, "', ", corgo, ", '", dp1o, "', '", dp2o, "', '", dp3o, "');");
            return sql_dml;
        }
        public static string ADD_sir_td_sklad(object ndto, object ppo, object sko, object cto, object p2o, object p1o, object mto,
            object mnt1o, object mnt2o, object ndso, object crdo, object dbo, object soppo, object nsko, object p5to)
        {
            string sql_dml =
            string.Concat("insert into sir_td_sklad(ndt, pp, sk, ct, p2, p1, mt, mnt1, mnt2, nds, crd, db, sopp, nsk, p5t)",
           " VALUES (", ndto, ",   ",
                        ppo, ", ",
                        sko, ", ",
                        cto, ", ",
                        p2o, ", ",
                        p1o, ", '",
                        mto, "', ",
                        mnt1o, ", ",
                        mnt2o, ", ",
                        ndso, ", ",
                        crdo, ", ",
                        dbo, ", ",
                        soppo, ", ",
                        nsko, ", ",
                        p5to, ");");
            return sql_dml;
        }
    }
    class prm_FormGridSelect : prm
    {
        public DB_SQL.ConnectionDB_SQL con;
        public prm_FormGridSelect(string sfilenameWithoutFileExto)
            : base(sfilenameWithoutFileExto)
        {
            con = new DB_SQL.ConnectionDB_SQL();
        }

        public string tk(ETALON.ENUMS.PLP_FormGridSelect prmo)
        {
            string s = ""; int icod = (int)prmo;
            for (int j = 0; j < dtp.Rows.Count; j++)
            {
                if (icod == Convert.ToInt32(dtp.Rows[j][0])) { s = Convert.ToString(dtp.Rows[j][1]); break; }
            }
            return s;
        }
        public int tk_int(ETALON.ENUMS.PLP_FormGridSelect prmo)
        {
            string s = ""; int icod = (int)prmo;
            for (int j = 0; j < dtp.Rows.Count; j++)
            {
                if (icod == Convert.ToInt32(dtp.Rows[j][0])) { s = Convert.ToString(dtp.Rows[j][1]); break; }
            }
            return Convert.ToInt32(s);
        }

        public void put(ETALON.ENUMS.PLP_FormGridSelect prmo, object o)
        {
            bool b = false; int icod = (int)prmo;
            for (int j = 0; j < dtp.Rows.Count; j++)
            {
                if (icod == Convert.ToInt32(dtp.Rows[j][0])) { dtp.Rows[j][1] = o; dtp.AcceptChanges(); b = true; break; }
            }
            if (b) save();
        }

        public string[] tk_array_string(ETALON.ENUMS.PLP_FormGridSelect prmo)
        {
            string s = tk(prmo); string[] sa = s.Split(';');
            return sa;
        }
        public int[] tk_array_int(ETALON.ENUMS.PLP_FormGridSelect prmo)
        {
            string s = tk(prmo); string[] sa = s.Split(';');
            return setIntArr_from_strArr(sa);
        }
        int[] setIntArr_from_strArr(string[] sao)
        {
            int[] ai = new int[sao.Length];
            for (int j = 0; j < sao.Length; j++)
            {
                ai[j] = Convert.ToInt32(sao[j]);
            }
            return ai;
        }
    }
    class prm_city : prm
    {
        public DB_SQL.ConnectionDB_SQL con;
        public prm_city()
        {
            con = new DB_SQL.ConnectionDB_SQL();
        }
        public string tk(ETALON.param prmo)
        {
            string s = ""; int icod = (int)prmo;
            for (int j = 0; j < dtp.Rows.Count; j++)
            {
                if (icod == Convert.ToInt32(dtp.Rows[j][0])) { s = Convert.ToString(dtp.Rows[j][1]); break; }
            }
            return s;
        }
        public string tk(ETALON.raw.PLP_reports plprep)
        {
            string s = ""; int icod = (int)plprep;
            for (int j = 0; j < dtp.Rows.Count; j++)
            {
                if (icod == Convert.ToInt32(dtp.Rows[j][0])) { s = Convert.ToString(dtp.Rows[j][1]); break; }
            }
            return s;
        }
        public string tk_readTagRd(ETALON.param prmo, ETALON.raw.typeTagRd tyta)
        {
            string s = ""; int icod = (int)prmo;
            int indexTag = (int)tyta;
            string stag = tk(icod); s = tagWork.readTAG(stag, indexTag);
            return s;
        }
        public string tk_readTagTd(ETALON.param prmo, ETALON.raw.typeTagTd tyta)
        {
            string s = ""; int icod = (int)prmo;
            int indexTag = (int)tyta;
            string stag = tk(icod); s = tagWork.readTAG(stag, indexTag);
            return s;
        }
        public int tk_int_codDate_fromDate(ETALON.param prmo)
        {
            string s = ""; int icod = (int)prmo;
            for (int j = 0; j < dtp.Rows.Count; j++)
            {
                if (icod == Convert.ToInt32(dtp.Rows[j][0])) { s = Convert.ToString(dtp.Rows[j][1]); break; }
            }
            return DATECOD.date_to_cod_int(s);
        }
        public int tk_int_codDate_fromDate_day(ETALON.param prmo)
        {
            string s = ""; int icod = (int)prmo;
            for (int j = 0; j < dtp.Rows.Count; j++)
            {
                if (icod == Convert.ToInt32(dtp.Rows[j][0])) { s = Convert.ToString(dtp.Rows[j][1]); break; }
            }
            return DATECOD.date_to_cod_int(s);
        }
        public int OKNO
        {
            get
            {
                if (System.Windows.Forms.MessageBox.Show("Пересчитать?", "Выбор", System.Windows.Forms.MessageBoxButtons.YesNo)
                    == System.Windows.Forms.DialogResult.Yes) { return 1; }  else { return 0; }
            }
        }
       
        public int tk_int_day_fromDate(ETALON.param prmo)
        {
            string s = ""; int icod = (int)prmo;
            for (int j = 0; j < dtp.Rows.Count; j++)
            {
                if (icod == Convert.ToInt32(dtp.Rows[j][0])) { s = Convert.ToString(dtp.Rows[j][1]); break; }
            }
            return DATECOD.date_day(s);
        }
        public int tk_int_month_fromDate(ETALON.param prmo)
        {
            string s = ""; int icod = (int)prmo;
            for (int j = 0; j < dtp.Rows.Count; j++)
            {
                if (icod == Convert.ToInt32(dtp.Rows[j][0])) { s = Convert.ToString(dtp.Rows[j][1]); break; }
            }
            return DATECOD.date_month(s);
        }
        public int tk_int_year_fromDate(ETALON.param prmo)
        {
            string s = ""; int icod = (int)prmo;
            for (int j = 0; j < dtp.Rows.Count; j++)
            {
                if (icod == Convert.ToInt32(dtp.Rows[j][0])) { s = Convert.ToString(dtp.Rows[j][1]); break; }
            }
            return DATECOD.date_year(s);
        }
        public void put(ETALON.param prmo, object o)
        {
            bool b = false; int icod = (int)prmo;
            for (int j = 0; j < dtp.Rows.Count; j++)
            {
                if (icod == Convert.ToInt32(dtp.Rows[j][0])) { dtp.Rows[j][1] = o; dtp.AcceptChanges(); b = true; break; }
            }
            if (b) save();
        }

        public DataTable selectAny(string sSQL)
        {
            MySqlCommand c = new MySqlCommand(sSQL);
            MySqlDataReader rd; con.co(tk(ETALON.param.server_1));
            c.Connection = con.conn;
            rd = c.ExecuteReader();
            DataTable dt = new DataTable();
            dt.Load(rd, LoadOption.OverwriteChanges);
            return dt;
        }
        public object selectScalar(string strSQL_SCALAR)
        {
            MySqlCommand cmd = con.conn.CreateCommand();
            cmd.CommandText = strSQL_SCALAR;
            object o = cmd.ExecuteScalar(); return o;
        }
        public void UpdateData(string strSQL_DML)
        {
            MySqlCommand cmd = con.conn.CreateCommand(); cmd.CommandText = strSQL_DML;
            cmd.ExecuteNonQuery(); 
        }

        public DataTable selectAnyMDB(string sSQL)
        {
            DataTable dt = new DataTable();
            try { OleDbCommand c = new OleDbCommand(sSQL); OleDbDataReader rd; c.Connection = con.cnn; rd = c.ExecuteReader(); dt.Load(rd, LoadOption.OverwriteChanges); }
            catch (Exception e) { functionService.shorts.m(e.Message); }
            return dt;
        }
        public void UpdateDataMDB(string strSQL_DML)
        {
            OleDbCommand cmd = con.cnn.CreateCommand(); cmd.CommandText = strSQL_DML; cmd.ExecuteNonQuery();
        }
        public object selectScalarMDB(string strSQL_SCALAR)
        {
            OleDbCommand cmd = con.cnn.CreateCommand();
            cmd.CommandText = strSQL_SCALAR; object o = cmd.ExecuteScalar(); return o;
        }

        public string tk_name(ETALON.param pro)
        {
            return functionService.nameCod.readName(tk(pro));
        }
        public int tk_int(ETALON.param pro)
        {
            return Convert.ToInt32(tk(pro));
        }
        public double tk_double(ETALON.param pro)
        {
            return Convert.ToDouble(tk(pro));
        }
        public int tc_int(ETALON.param pro)
        {
            if (functionService.IsAny.IsMakeRead_as_nameCod(tk(pro))) return Convert.ToInt32(functionService.nameCod.readCod(tk(pro))); else return 888;
        }
        public string tc(ETALON.param pro)
        {
            if (functionService.IsAny.IsMakeRead_as_nameCod(tk(pro))) return functionService.nameCod.readCod(tk(pro)); else return "888";
        }

        //public static int codWorkDAY_10913
        //{
        //    get
        //    {

        //        int dc = functionService.DATECOD.date_to_cod_int( tk(ETALON.param.day_work_7));
        //        int dcy = functionService.DATECOD.yearCod(Convert.ToInt32(dc.ToString().Substring(0, 4)));
        //        string dcd = dc.ToString().Substring(4, 4);
        //        string s = string.Concat(dcy, dcd);
        //        return Convert.ToInt32(s);
        //    }
        //}
        //public static int codWorkDAY_20100913
        //{
        //    get
        //    {
        //        return functionService.DATECOD.date_to_cod_int(tk(ETALON.param.day_work_7));
        //    }
        //}
    }
}
